﻿using System;

namespace padmsg._api
{
    using yunio;
    internal partial class padapi
    {
        public static YunioJson download_cdn(string uri, string token, string aeskey, int filetype, string fileuri)
        {
            uri += "/message/SendCdnDownload";

            var json = YunioJson.NewObj().SetText("AesKey", aeskey).SetNumber("FileType", filetype).SetText("FileURL", fileuri);
            return YunioHttp.PostJson(uri, YunioParam.New("key", token), json);
        }
        public static YunioJson download_voice(string uri, string token, string bufid, int length, string newmsg_id)
        {
            uri += "/message/GetMsgVoice";

            var json = new YunioJson("{'ToUserName': ''}").SetText("Bufid", bufid).SetNumber("Length", length).SetText("NewMsgId", newmsg_id);
            return YunioHttp.PostJson(uri, YunioParam.New("key", token), json);
        }
    }
}
